Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Text.​Json.​Serialization.​Metadata.​JsonTypeInfo<​T>
Assembly: System.Text.Json
Inheritance: object → JsonTypeInfo → JsonTypeInfo
Provides JSON serialization-related metadata about a type.
Properties
public
Func<​T>
CreateObject
Gets or sets a parameterless factory to be used on deserialization.
public
Action<​Utf8JsonWriter, T>
SerializeHandler
Serializes an instance of <typeparamref name="T" /> using <see cref="T:System.Text.Json.Serialization.JsonSourceGenerationOptionsAttribute" /> values specified at design time.
public
JsonConverter
Converter
Gets the <see cref="T:System.Text.Json.Serialization.JsonConverter" /> associated with the current type.
public
Func<​object>
CreateObject
Gets or sets a parameterless factory to be used on deserialization.
ConstructorAttributeProvider
Gets or sets an attribute provider corresponding to the deserialization constructor.
public
Type
ElementType
Gets the element type corresponding to an enumerable, dictionary or optional type.
public
bool
IsReadOnly
Gets a value that indicates whether the current instance has been locked for modification.
public
Type
KeyType
Gets the key type corresponding to a dictionary type.
public
JsonTypeInfoKind
Kind
Gets a value that describes the kind of contract metadata that the current instance specifies.
public
JsonNumberHandling?
NumberHandling
Gets or sets the type-level <see cref="P:System.Text.Json.JsonSerializerOptions.NumberHandling" /> override.
public
Action<​object>
OnDeserialized
Gets or sets a callback to be invoked after deserialization occurs.
public
Action<​object>
OnDeserializing
Gets or sets a callback to be invoked before deserialization occurs.
public
Action<​object>
OnSerialized
Gets or sets a callback to be invoked after serialization occurs.
public
Action<​object>
OnSerializing
Gets or sets a callback to be invoked before serialization occurs.
public
JsonSerializerOptions
Options
Gets the <see cref="T:System.Text.Json.JsonSerializerOptions" /> value associated with the current <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> instance.
public
IJsonTypeInfoResolver
OriginatingResolver
Gets or sets the <see cref="T:System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver" /> from which this metadata instance originated.
public
JsonPolymorphismOptions
PolymorphismOptions
Gets or sets a configuration object specifying polymorphism metadata.
public
JsonObjectCreationHandling?
PreferredPropertyObjectCreationHandling
Gets or sets the preferred <see cref="T:System.Text.Json.Serialization.JsonObjectCreationHandling" /> value for properties contained in the type.
public
Collections.​Generic.​IList<​JsonPropertyInfo>
Properties
Gets the list of <see cref="T:System.Text.Json.Serialization.Metadata.JsonPropertyInfo" /> metadata corresponding to the current type.
public
Type
Type
Gets the <see cref="P:System.Text.Json.Serialization.Metadata.JsonTypeInfo.Type" /> for which the JSON serialization contract is being defined.
public
JsonUnmappedMemberHandling?
UnmappedMemberHandling
Gets or sets the type-level <see cref="T:System.Text.Json.Serialization.JsonUnmappedMemberHandling" /> override.
Methods
public
JsonPropertyInfo
CreateJsonPropertyInfo​(Type propertyType,
string name)
Inherited from JsonTypeInfo
Creates a blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonPropertyInfo" /> instance for the current <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> .
Returns A blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonPropertyInfo" /> instance.
propertyType
The declared type for the property.
name
The property name used in JSON serialization and deserialization.
public
void
MakeReadOnly​()
Inherited from JsonTypeInfo
Locks the current instance for further modification.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object